package com.guigu.qingcheng.service;

import com.qingcheng.entity.Result;
import com.qingcheng.domain.Goods;
import com.qingcheng.pojo.goods.TbCategory;
import com.qingcheng.pojo.goods.TbSpu;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
@FeignClient(value = "service-goods")
public interface CategoryService {

    // 返回菜单列表
    @GetMapping("/goods/category/returnMenus")
    public Result ReturnMenus();

    // 根据spu_id查询商品
    @GetMapping("goods/spu/findGoodById")
    public Goods findGoodById(@RequestParam String id);

    // 根据分类id查询
    @GetMapping("goods/category/findById")
    public TbCategory findById(@RequestParam Integer id);

    // 远程调用根据商品的分类随机查询出推荐的手机
    @GetMapping("goods/category/random")
    public List<Map> recommend(@RequestParam("category3") Integer category3);

    // 商品详情表的推荐相关列表
    @GetMapping("goods/category/recommendlists")
    public List<TbCategory> recommendlists(@RequestParam("id") String id);

    //  查询出家用电器下七天销量最高的分类
    @GetMapping("goods/category/appliances")
    HashMap<Map,List<TbSpu>> appliances(@RequestParam("parent_id") String parent_id);

    // 首页菜单的热卖商品显示
    @GetMapping("goods/spu/best")
    public List<Map> Best();

    // 显示菜单首页新品显示
    @GetMapping("goods/spu/newproduct")
    public List<Map> newproduct();

    // 猜你喜欢
    @GetMapping("goods/spu/like")
    List<Map> like();

    //  今日推荐
    @GetMapping("goods/category/today")
    public List<Map> Today();
}
